package org.jackysoft.interceptor;

import java.lang.reflect.Method;
import java.util.Collection;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.jackysoft.annotations.ActionRequestMethod;
import org.jackysoft.annotations.MethodInceptor;
import org.springframework.web.servlet.ModelAndView;

@MethodInceptor(method = ActionRequestMethod.sorted)
public class SortInterceptor extends AbstractInterceptor {

	@Override
	public void postHandle(HttpServletRequest request,
			HttpServletResponse response, Object handler,
			ModelAndView modelAndView) throws Exception {

		Method sort = service.getClass().getMethod("doOrder", Collection.class);
		sort.invoke(service, beans);

	}

}
